﻿<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>教务管理系统 - 我的课表</title>
    <link href="${pageContext.request.contextPath}/resources/bootstrap5/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap Icons - 本地版本 -->
    <link href="${pageContext.request.contextPath}/resources/bootstrap-icons/1.11.3/bootstrap-icons.css" rel="stylesheet">
    <!-- Bootstrap Icons - 备用CDN -->
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <!-- 第二个备用CDN -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
    <style>
        body {
            font-family: "Microsoft YaHei", sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }

        .header {
            background-color: #1976d2;
            color: white;
            padding: 10px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .header h2 {
            margin: 0;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
        }

        .header h2 img {
            height: 36px;
            margin-right: 10px;
        }

        .header .breadcrumb {
            margin: 0;
            background: transparent;
            color: white;
        }

        .header .breadcrumb a {
            color: rgba(255,255,255,0.8);
            text-decoration: none;
        }

        .header .breadcrumb a:hover {
            color: white;
        }

        .header .breadcrumb-item.active {
            color: white;
        }

        .header .breadcrumb-item+.breadcrumb-item::before {
            color: rgba(255,255,255,0.6);
        }

        /* 侧边栏样式 */
        .sidebar {
            position: fixed;
            top: 56px;
            left: 0;
            bottom: 0;
            width: 250px;
            background-color: white;
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
            overflow-y: auto;
            z-index: 100;
            padding-top: 20px;
        }

        .sidebar-menu {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .sidebar-menu > li {
            margin-bottom: 5px;
        }

        .sidebar-menu > li > a {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: #333;
            text-decoration: none;
            transition: all 0.3s;
            border-left: 3px solid transparent;
        }

        .sidebar-menu > li > a:hover {
            background-color: #f0f0f0;
            border-left-color: #1976d2;
        }

        .sidebar-menu > li > a.active {
            background-color: #e3f2fd;
            border-left-color: #1976d2;
            color: #1976d2;
        }

        .sidebar-menu > li > a i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
            font-size: 1.1rem;
        }

        .sidebar-submenu {
            list-style: none;
            padding-left: 53px;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .sidebar-menu > li.open .sidebar-submenu {
            max-height: 500px;
        }

        .sidebar-submenu > li > a {
            display: block;
            padding: 8px 0;
            color: #666;
            text-decoration: none;
            transition: all 0.3s;
        }

        .sidebar-submenu > li > a:hover {
            color: #1976d2;
        }

        .sidebar-submenu > li > a.active {
            color: #1976d2;
            font-weight: 500;
        }

        /* 内容区样式 */
        .content {
            margin-left: 250px;
            padding: 76px 20px 20px;
        }

        /* 用户名下拉菜单样式 */
        .header-user {
            display: flex;
            align-items: center;
            position: relative;
        }
        .header-user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 8px;
            object-fit: cover;
            background: #fff;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .header-user-avatar:hover {
            transform: scale(1.1);
        }
        .header-user-name {
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            font-family: 'Microsoft YaHei', Arial, sans-serif;
        }
        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            min-width: 160px;
            z-index: 1001;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            margin-top: 8px;
        }
        .user-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        .user-dropdown::before {
            content: '';
            position: absolute;
            top: -6px;
            right: 20px;
            width: 12px;
            height: 12px;
            background: #fff;
            transform: rotate(45deg);
            box-shadow: -2px -2px 4px rgba(0,0,0,0.1);
        }
        .user-dropdown-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            color: #333;
            text-decoration: none;
            transition: background 0.2s;
            border-bottom: 1px solid #f0f0f0;
            font-family: 'Microsoft YaHei', Arial, sans-serif;
        }
        .user-dropdown-item:last-child {
            border-bottom: none;
        }
        .user-dropdown-item:hover {
            background: #f8f9fa;
            color: #2196f3;
        }
        .user-dropdown-item i {
            margin-right: 8px;
            width: 16px;
            text-align: center;
        }

        /* 课程表样式 */
        .schedule-container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 20px rgba(0,0,0,0.08);
            overflow: hidden;
            margin-bottom: 20px;
        }

        .schedule-header {
            background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
            color: white;
            padding: 20px;
            text-align: center;
        }

        .schedule-header h3 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 600;
        }

        .schedule-header p {
            margin: 0;
            font-size: 0.9rem;
            color: rgba(255,255,255,0.9);
        }

        .schedule-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .schedule-table th {
            background: #f8f9fa;
            padding: 15px 8px;
            text-align: center;
            font-weight: 600;
            color: #495057;
            border: 1px solid #e9ecef;
            vertical-align: middle;
        }

        .schedule-table td {
            border: 1px solid #e9ecef;
            padding: 0;
            height: 80px;
            vertical-align: top;
            position: relative;
        }

        .time-column {
            background: #f8f9fa;
            width: 120px;
            text-align: center;
            font-weight: 500;
            color: #6c757d;
            vertical-align: middle !important;
        }

        .time-period {
            font-size: 0.85rem;
            line-height: 1.2;
        }

        .course-cell {
            width: calc((100% - 120px) / 7);
            position: relative;
        }

        .course-info {
            padding: 8px;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            text-align: center;
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            color: #1976d2;
            border-radius: 6px;
            margin: 4px;
            position: relative;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }

        .course-info:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }

        .course-name {
            font-weight: 600;
            font-size: 0.85rem;
            margin-bottom: 4px;
            line-height: 1.2;
        }

        .course-teacher {
            font-size: 0.75rem;
            color: #666;
            margin-bottom: 2px;
        }

        .course-classroom {
            font-size: 0.7rem;
            color: #888;
            background: rgba(255,255,255,0.8);
            padding: 2px 6px;
            border-radius: 10px;
            display: inline-block;
        }

        .empty-cell {
            height: 100%;
            background: #fafafa;
            border-radius: 6px;
            margin: 4px;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s;
            }

            .sidebar.active {
                transform: translateX(0);
            }

            .content {
                margin-left: 0;
            }

            .course-cell {
                width: auto;
            }

            .schedule-table {
                font-size: 0.8rem;
            }

            .course-info {
                padding: 6px;
            }

            .course-name {
                font-size: 0.8rem;
            }

            .course-teacher, .course-classroom {
                font-size: 0.7rem;
            }
        }

        /* 不同课程的主题颜色 */
        .course-info.math {
            background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
            color: #2e7d32;
        }

        .course-info.english {
            background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
            color: #ef6c00;
        }

        .course-info.computer {
            background: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%);
            color: #7b1fa2;
        }

        .course-info.physics {
            background: linear-gradient(135deg, #e0f2f1 0%, #80cbc4 100%);
            color: #00695c;
        }

        .course-info.default {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            color: #1976d2;
        }
    </style>
</head>
<body>
<!-- 头部导航栏 -->
<div class="header">
    <div class="header-left">
        <h2><img src="${pageContext.request.contextPath}/resources/images/logo.png" alt="Logo"> 教务管理系统</h2>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/student/home">首页</a></li>
                <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/student/my-courses">教学管理</a></li>
                <li class="breadcrumb-item active">我的课表</li>
            </ol>
        </nav>
    </div>

    <!-- 用户名下拉菜单 -->
    <div class="header-user" id="userDropdownContainer">
        <img src="${pageContext.request.contextPath}/resources/images/baimao.png" class="header-user-avatar" alt="用户头像" id="userAvatar">
        <span class="header-user-name" id="userName">
            <c:choose>
                <c:when test="${not empty currentStudent and not empty currentStudent.user and not empty currentStudent.user.realName}">
                    ${currentStudent.user.realName}
                </c:when>
                <c:when test="${not empty sessionScope.loggedInUser and not empty sessionScope.loggedInUser.realName}">
                    ${sessionScope.loggedInUser.realName}
                </c:when>
                <c:when test="${not empty sessionScope.loggedInUser and not empty sessionScope.loggedInUser.username}">
                    ${sessionScope.loggedInUser.username}
                </c:when>
                <c:otherwise>
                    学生
                </c:otherwise>
            </c:choose>
        </span>
        <div class="user-dropdown" id="userDropdown">
            <a href="#" class="user-dropdown-item" onclick="showProfileModal()">
                <i class="bi bi-person-circle"></i>
                个人信息
            </a>
            <a href="${pageContext.request.contextPath}/student/changePassword" class="user-dropdown-item">
                <i class="bi bi-key"></i>
                修改密码
            </a>
            <a href="${pageContext.request.contextPath}/user/logout" class="user-dropdown-item">
                <i class="bi bi-box-arrow-right"></i>
                退出登录
            </a>
        </div>
    </div>
</div>

<!-- 引用公共的侧边栏组件 -->
<%@ include file="../common/student-sidebar.jsp" %>

<!-- 主内容区 -->
<div class="content">
    <c:if test="${not empty error}">
        <div class="alert alert-danger" role="alert">
            <i class="bi bi-exclamation-triangle"></i> ${error}
        </div>
    </c:if>

    <!-- 课程表容器 -->
    <div class="schedule-container">
        <div class="schedule-header">
            <h3><i class="bi bi-calendar-week me-2"></i>我的课程表</h3>
            <p class="mb-0">
                学号：${currentStudent.studentNo} |
                姓名：${currentStudent.user.realName} |
                班级：<c:choose>
                <c:when test="${not empty currentStudent.clazz}">
                    ${currentStudent.clazz.name}
                </c:when>
                <c:otherwise>
                    未分班
                </c:otherwise>
            </c:choose>
            </p>
        </div>

        <div class="table-responsive">
            <table class="schedule-table">
                <thead>
                <tr>
                    <th class="time-column">时间</th>
                    <th class="course-cell">星期一</th>
                    <th class="course-cell">星期二</th>
                    <th class="course-cell">星期三</th>
                    <th class="course-cell">星期四</th>
                    <th class="course-cell">星期五</th>
                    <th class="course-cell">星期六</th>
                    <th class="course-cell">星期日</th>
                </tr>
                </thead>
                <tbody>
                <!-- 第一大节 -->
                <tr>
                    <td class="time-column">
                        <div class="time-period">
                            <strong>第一大节</strong><br>
                            <small>08:00 - 09:30</small>
                        </div>
                    </td>
                    <c:forEach var="weekday" begin="1" end="7">
                        <td class="course-cell">
                            <c:set var="found" value="false" />
                            <c:forEach var="item" items="${scheduleList}">
                                <c:if test="${item.weekday == weekday && item.period == 1 && item.hasSchedule && !found}">
                                    <c:set var="found" value="true" />
                                    <div class="course-info default">
                                        <div class="course-name">${item.courseName}</div>
                                        <div class="course-teacher">${item.teacherName}</div>
                                        <div class="course-classroom">${item.classroom}</div>
                                    </div>
                                </c:if>
                            </c:forEach>
                            <c:if test="${!found}">
                                <div class="empty-cell"></div>
                            </c:if>
                        </td>
                    </c:forEach>
                </tr>

                <!-- 第二大节 -->
                <tr>
                    <td class="time-column">
                        <div class="time-period">
                            <strong>第二大节</strong><br>
                            <small>09:40 - 12:00</small>
                        </div>
                    </td>
                    <c:forEach var="weekday" begin="1" end="7">
                        <td class="course-cell">
                            <c:set var="found" value="false" />
                            <c:forEach var="item" items="${scheduleList}">
                                <c:if test="${item.weekday == weekday && item.period == 2 && item.hasSchedule && !found}">
                                    <c:set var="found" value="true" />
                                    <div class="course-info default">
                                        <div class="course-name">${item.courseName}</div>
                                        <div class="course-teacher">${item.teacherName}</div>
                                        <div class="course-classroom">${item.classroom}</div>
                                    </div>
                                </c:if>
                            </c:forEach>
                            <c:if test="${!found}">
                                <div class="empty-cell"></div>
                            </c:if>
                        </td>
                    </c:forEach>
                </tr>

                <!-- 第三大节 -->
                <tr>
                    <td class="time-column">
                        <div class="time-period">
                            <strong>第三大节</strong><br>
                            <small>14:00 - 15:30</small>
                        </div>
                    </td>
                    <c:forEach var="weekday" begin="1" end="7">
                        <td class="course-cell">
                            <c:set var="found" value="false" />
                            <c:forEach var="item" items="${scheduleList}">
                                <c:if test="${item.weekday == weekday && item.period == 3 && item.hasSchedule && !found}">
                                    <c:set var="found" value="true" />
                                    <div class="course-info default">
                                        <div class="course-name">${item.courseName}</div>
                                        <div class="course-teacher">${item.teacherName}</div>
                                        <div class="course-classroom">${item.classroom}</div>
                                    </div>
                                </c:if>
                            </c:forEach>
                            <c:if test="${!found}">
                                <div class="empty-cell"></div>
                            </c:if>
                        </td>
                    </c:forEach>
                </tr>

                <!-- 第四大节 -->
                <tr>
                    <td class="time-column">
                        <div class="time-period">
                            <strong>第四大节</strong><br>
                            <small>15:40 - 17:00</small>
                        </div>
                    </td>
                    <c:forEach var="weekday" begin="1" end="7">
                        <td class="course-cell">
                            <c:set var="found" value="false" />
                            <c:forEach var="item" items="${scheduleList}">
                                <c:if test="${item.weekday == weekday && item.period == 4 && item.hasSchedule && !found}">
                                    <c:set var="found" value="true" />
                                    <div class="course-info default">
                                        <div class="course-name">${item.courseName}</div>
                                        <div class="course-teacher">${item.teacherName}</div>
                                        <div class="course-classroom">${item.classroom}</div>
                                    </div>
                                </c:if>
                            </c:forEach>
                            <c:if test="${!found}">
                                <div class="empty-cell"></div>
                            </c:if>
                        </td>
                    </c:forEach>
                </tr>

                <!-- 第五大节 -->
                <tr>
                    <td class="time-column">
                        <div class="time-period">
                            <strong>第五大节</strong><br>
                            <small>18:00 - 20:00</small>
                        </div>
                    </td>
                    <c:forEach var="weekday" begin="1" end="7">
                        <td class="course-cell">
                            <c:set var="found" value="false" />
                            <c:forEach var="item" items="${scheduleList}">
                                <c:if test="${item.weekday == weekday && item.period == 5 && item.hasSchedule && !found}">
                                    <c:set var="found" value="true" />
                                    <div class="course-info default">
                                        <div class="course-name">${item.courseName}</div>
                                        <div class="course-teacher">${item.teacherName}</div>
                                        <div class="course-classroom">${item.classroom}</div>
                                    </div>
                                </c:if>
                            </c:forEach>
                            <c:if test="${!found}">
                                <div class="empty-cell"></div>
                            </c:if>
                        </td>
                    </c:forEach>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- 课程表统计信息 -->
    <div class="row mt-4">
        <div class="col-md-3 mb-3">
            <div class="card text-center" style="border-left: 4px solid #007bff;">
                <div class="card-body">
                    <h5 class="card-title text-primary">${scheduleList.size()}</h5>
                    <p class="card-text">总课时</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card text-center" style="border-left: 4px solid #28a745;">
                <div class="card-body">
                    <h5 class="card-title text-success">
                        <c:set var="weekCourseCount" value="0" />
                        <c:forEach var="item" items="${scheduleList}">
                            <c:if test="${item.hasSchedule && item.weekday >= 1 && item.weekday <= 5}">
                                <c:set var="weekCourseCount" value="${weekCourseCount + 1}" />
                            </c:if>
                        </c:forEach>
                        ${weekCourseCount}
                    </h5>
                    <p class="card-text">工作日课程</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card text-center" style="border-left: 4px solid #ffc107;">
                <div class="card-body">
                    <h5 class="card-title text-warning">
                        <c:set var="weekendCourseCount" value="0" />
                        <c:forEach var="item" items="${scheduleList}">
                            <c:if test="${item.hasSchedule && (item.weekday == 6 || item.weekday == 7)}">
                                <c:set var="weekendCourseCount" value="${weekendCourseCount + 1}" />
                            </c:if>
                        </c:forEach>
                        ${weekendCourseCount}
                    </h5>
                    <p class="card-text">周末课程</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card text-center" style="border-left: 4px solid #dc3545;">
                <div class="card-body">
                    <h5 class="card-title text-danger">
                        <c:set var="totalScheduleSlots" value="${7 * 5}" />
                        <c:set var="usedScheduleSlots" value="0" />
                        <c:forEach var="item" items="${scheduleList}">
                            <c:if test="${item.hasSchedule}">
                                <c:set var="usedScheduleSlots" value="${usedScheduleSlots + 1}" />
                            </c:if>
                        </c:forEach>
                        ${totalScheduleSlots - usedScheduleSlots}
                    </h5>
                    <p class="card-text">空闲时段</p>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 个人信息模态框 -->
<div class="modal fade" id="profileModal" tabindex="-1" aria-labelledby="profileModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="border-radius: 12px; border: none;">
            <div class="modal-header" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 12px 12px 0 0; padding: 20px 30px;">
                <h5 class="modal-title" id="profileModalLabel" style="font-weight: 600; font-size: 1.3rem;">
                    <i class="bi bi-person-circle me-2"></i>个人信息
                </h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body" style="padding: 30px;">
                <c:if test="${not empty currentStudent}">
                    <div class="row mb-4">
                        <div class="col-12 text-center">
                            <div style="width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 15px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem;">
                                <i class="bi bi-person-circle"></i>
                            </div>
                            <h5 class="mb-1">
                                <c:choose>
                                    <c:when test="${not empty currentStudent.user.realName}">
                                        ${currentStudent.user.realName}
                                    </c:when>
                                    <c:otherwise>
                                        学生信息
                                    </c:otherwise>
                                </c:choose>
                            </h5>
                            <p class="text-muted mb-0">学生个人信息详情</p>
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-person me-2"></i>姓名</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.user.realName}">
                                            ${currentStudent.user.realName}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-card-text me-2"></i>学号</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.studentNo}">
                                            ${currentStudent.studentNo}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-person-badge me-2"></i>用户名</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.user.username}">
                                            ${currentStudent.user.username}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-gender-ambiguous me-2"></i>性别</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${currentStudent.gender == 1}">
                                            <span class="badge" style="background: #e3f2fd; color: #1976d2;">男</span>
                                        </c:when>
                                        <c:when test="${currentStudent.gender == 0}">
                                            <span class="badge" style="background: #fce4ec; color: #e91e63;">女</span>
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-building me-2"></i>班级</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.clazz and not empty currentStudent.clazz.name}">
                                            ${currentStudent.clazz.name}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-mortarboard me-2"></i>专业</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.clazz and not empty currentStudent.clazz.major and not empty currentStudent.clazz.major.name}">
                                            ${currentStudent.clazz.major.name}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未填写</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-bank me-2"></i>学院</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.clazz and not empty currentStudent.clazz.major and not empty currentStudent.clazz.major.college and not empty currentStudent.clazz.major.college.name}">
                                            ${currentStudent.clazz.major.college.name}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未分配学院</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-envelope me-2"></i>电子邮箱</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.email}">
                                            ${currentStudent.email}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未设置</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div style="padding: 15px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
                                <strong style="color: #667eea;"><i class="bi bi-telephone me-2"></i>联系电话</strong>
                                <div class="mt-1">
                                    <c:choose>
                                        <c:when test="${not empty currentStudent.phone}">
                                            ${currentStudent.phone}
                                        </c:when>
                                        <c:otherwise>
                                            <span class="text-muted">未设置</span>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </div>
                    </div>
                </c:if>
                
                <c:if test="${empty currentStudent}">
                    <div class="text-center py-5">
                        <i class="bi bi-exclamation-circle text-warning" style="font-size: 3rem;"></i>
                        <h5 class="mt-3">无法获取学生信息</h5>
                        <p class="text-muted">请联系管理员或重新登录</p>
                    </div>
                </c:if>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
                <a href="${pageContext.request.contextPath}/student/changePassword" class="btn" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white;">
                    <i class="bi bi-key me-1"></i>修改密码
                </a>
            </div>
        </div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/resources/js/jquery-3.6.0.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/bootstrap5/js/bootstrap.bundle.min.js"></script>
<script>
    // 显示个人信息模态框
    function showProfileModal() {
        const profileModal = new bootstrap.Modal(document.getElementById('profileModal'));
        profileModal.show();
    }

    // 为课程表单元格添加悬停效果
    document.addEventListener('DOMContentLoaded', function() {
        const courseCells = document.querySelectorAll('.course-info');
        courseCells.forEach(cell => {
            cell.addEventListener('mouseenter', function() {
                this.style.transform = 'translateY(-3px)';
                this.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)';
                this.style.zIndex = '10';
            });

            cell.addEventListener('mouseleave', function() {
                this.style.transform = 'translateY(0)';
                this.style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
                this.style.zIndex = '1';
            });
        });
    });

    // 为课程表添加动画效果
    document.addEventListener('DOMContentLoaded', function() {
        const scheduleRows = document.querySelectorAll('.schedule-table tbody tr');

        scheduleRows.forEach((row, index) => {
            setTimeout(() => {
                row.style.opacity = '1';
                row.style.transform = 'translateY(0)';
            }, 100 * index);
        });
    });
</script>
</body>
</html>